﻿using DG.Tweening;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;

namespace Gp.GUI.Inventory {
    public class PhraseUIEntry : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler {
        public TMP_Text title;
        public TMP_Text description;
        public CanvasGroup tooltips;


        public void OnPointerEnter(PointerEventData eventData) {
            tooltips.DOFade(1, .2f);
            tooltips.transform.DOScale(1, .2f);
        }


        public void OnPointerExit(PointerEventData eventData) {
            tooltips.DOFade(0, .2f);
            tooltips.transform.DOScale(.2f, 0);
        }

        public void Render(string titleText, string descriptionText) {
            description.text = descriptionText;
            title.text = titleText;
        }
    }
}